#include "pit.h"

unsigned long ticks = 0;

void initPIT(int freq)
{
	irq_install_handler(0, (void*)timer_handler);
	int counter = 1193182 / freq;
	outB(0x43, 0x30);
	outB(0x40, counter & 0xFF);
	outB(0x40, counter >> 8);
	shellPrint("Pit initialisiert!\n");
}

void timer_handler(void)
{
	ticks++;
	shellPrint("Tick: %d\n", ticks);
}
